const KoaRouter = require('@koa/router')

// const userController = require('../controller/user.controller')
const { verifyAuth } = require('../middleware/login.middleware')
const {handleAvatar,handlePicture,pictureResize} =require("../middleware/file.moddleware")
const { create,savePictureInfo } = require('../controller/file.controller')
// 创建router对象
const fileRouter = new KoaRouter({ prefix: '/file' })

fileRouter.post(
  '/avatar',
  verifyAuth,
  handleAvatar,
  create
)

fileRouter.post("/picture",verifyAuth,handlePicture,pictureResize,savePictureInfo)
// 导出路由
module.exports = fileRouter
